﻿@using Pyramid.Extentions
@using Pyramid.Models
@model  IEnumerable<Account>
@{
	var pm = (PagerModel) ViewBag.PagerModel;
	var qm = (AccountQueryModel) ViewBag.QueryModel;
	var userTypes = EnumExtentions.ToSelectList(typeof (UserTypes), qm.UserType, true);
}

@using (Html.BeginForm("List", "Account", FormMethod.Post, new {id = "pagerForm"}))
{
	<input type="hidden" name="pageNum" value="1" />
	<input type="hidden" name="numPerPage" value="${model.numPerPage}" />
}

<div class="pageHeader">
	@using (Html.BeginForm("List", "Account", FormMethod.Post, new {onsubmit = "return navTabSearch(this);"}))
	{
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td>查询关键词：<input type="text" name="keywords" rel="pagerForm" value="@qm.Keywords" /></td>
					<td>
						@Html.DropDownList("UserType", userTypes, new {@class = "combox", rel = "pagerForm"})
					</td>
					<td>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">查询</button>
							</div>
						</div>
					</td>
				</tr>
			</table>
		</div>
	}
</div>
<div class="pageContent">
	<table class="table" width="100%" layouth="86">
		<thead>
			<tr>
				<th>@Html.DisplayNameFor(m=>m.UserId)</th>
				<th>@Html.DisplayNameFor(m=>m.FullName)</th>
				<th>@Html.DisplayNameFor(m=>m.Email)</th>
				<th>@Html.DisplayNameFor(m=>m.Mobile)</th>
				<th>@Html.DisplayNameFor(m=>m.UserType)</th>
				<th>@Html.DisplayNameFor(m=>m.ExtInfoName)</th>
			</tr>
		</thead>
		<tbody>
			@foreach (var s in Model)
			{
				<tr target="id" rel="@s.Id">
					<td>@s.UserId</td>
					<td>@s.FullName</td>
					<td>@s.Email</td>
					<td>@s.Mobile</td>
					<td>@s.UserTypeString</td>
					<td>@s.ExtInfoName</td>
				</tr>
			}
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange=" navTabPageBreak({ numPerPage: this.value }) ">
				<option value="20">20</option>
				<option value="50">50</option>
				<option value="100">100</option>
				<option value="200">200</option>
			</select>
			<span>条，共 @pm.TotalCount 条</span>
		</div>
		<div class="pagination" targettype="navTab" totalcount="@pm.TotalCount" numperpage="@pm.PageSize" pagenumshown="10" currentpage="@pm.CurrentPageIndex"></div>
	</div>
</div>
